import java.util.Scanner;
//小易的升级之路
public class test {
        public static void main(String[]args){
            Scanner scan=new Scanner(System.in);
            while(scan.hasNext()){
                int num=scan.nextInt();
                int c=scan.nextInt();
                for(int i=0;i<num;i++){
                    int power=scan.nextInt();
                    if(c>power){
                        c+=power;
                    }else{
                        c+=gcd(c,power);
                    }
                }
                System.out.println(c);
            }

        }
        public static int gcd(int a,int b){
            int c;
            while((c=a%b)!=0){
                a=b;b=c;
            }
            return b;
        }
    }

